package com.naire.modul.questionnaire.service;

import net.common.service.GeneralService;

import com.naire.modul.questionnaire.dao.Projeckpi_answerDao;
import com.naire.modul.questionnaire.dao.impl.Projeckpi_answerDaoImpl;
import com.naire.modul.questionnaire.vo.Projeckpi_answerVo;

public class QuestionnaireEditorService extends GeneralService {

	private String code;
	private Projeckpi_answerVo bean;
	private Integer project_id;

	@Override
	public void execute() throws Exception {
		Projeckpi_answerDao dao = new Projeckpi_answerDaoImpl();
		bean.setProject_id(project_id);
		bean.setKpi_num(code);
		if(bean.getProject_answer_id() != null) {
			dao.update(bean);
		} else {
			dao.insert(bean);
		}
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setBean(Projeckpi_answerVo bean) {
		this.bean = bean;
	}

	public void setProject_id(Integer project_id) {
		this.project_id = project_id;
	}

}
